﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue 测试实例 - 菜鸟教程(runoob.com)</title>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
	
</head>
<body>
<div id="app">
    <p >现在你看到我了</p>
    <button @click='getinfo'>获取请求</button>
	<p>{{info}}</p>
</div>
    
<script>
new Vue({
  el: '#app',
  data: {
     info:'123',
  },
		methods:{
		getinfo:function(){
			var that = this;
			axios.get("http://www.coderutil.com/api/resou/v1/weibo")
				.then(function(response){that.info=response},
					  function(err){that.info='请求失败'});
			
						 
		}
			
		
		}
		
		
})
</script>
</body>
</html>